﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>14 链式动画</title>
    <style type="text/css">
        * {
            padding: 0;
            margin: 0;
        }
        
        #box {
            width: 200px;
            height: 200px;
            background-color: palevioletred;
            opacity: 0.3;
        }
    </style>
</head>

<body>
    <div id="box"></div>
    <script src="js/myAnimation.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        window.onload = function() {
            var box = document.getElementById('box');
            box.onmouseover = function() {
                startAnimation(box, 'width', 500, function() {
                    startAnimation(box, 'height', 400, function() {
                        startAnimation(box, 'opacity', 100);
                    })
                })
            }


        }
    </script>
</body>

</html>